import {h, init} from 'snabbdom'
import styleModule from 'snabbdom/modules/style'
import eventListenersModule from 'snabbdom/modules/eventlisteners'

let patch = init([
    styleModule,
    eventListenersModule
])

let vnode = h('div', {
    style: {
        background: 'red'
    },
    on: {
        click: eventHandler
    }
}, [
    h('h1', 'hello world!!!'),
    h('p', 'hello p')
])

function eventHandler() {
    console.log(123)
}

let app = document.querySelector('#app')

patch(app, vnode)
